package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017/12/12.
 */
@Entity
@Table(name = "task_mould_require", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class TaskMouldRequireEntity extends IAcross
{
    private int tmrId;
    private String requirement;
    private BigDecimal amount;
    private Integer tmId;
    private String requirementOld;
    private BigDecimal amountOld;
    private Integer createId;
    private Timestamp createDate;

    public TaskMouldRequireEntity()
    {
        super();
    }

    public TaskMouldRequireEntity(IAcross ia)
    {
        super(ia);
    }

    @Id
    @Column(name = "tmr_Id")
    @GeneratedValue
    public int getTmrId() {
        return tmrId;
    }

    public void setTmrId(int tmrId) {
        this.tmrId = tmrId;
    }

    @Basic
    @Column(name = "requirement")
    public String getRequirement() {
        return requirement;
    }

    public void setRequirement(String requirement) {
        this.requirement = requirement;
    }

    @Basic
    @Column(name = "amount")
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "tm_id")
    public Integer getTmId() {
        return tmId;
    }

    public void setTmId(Integer tmId) {
        this.tmId = tmId;
    }

    @Basic
    @Column(name = "requirement_old")
    public String getRequirementOld() {
        return requirementOld;
    }

    public void setRequirementOld(String requirementOld) {
        this.requirementOld = requirementOld;
    }

    @Basic
    @Column(name = "amount_old")
    public BigDecimal getAmountOld() {
        return amountOld;
    }

    public void setAmountOld(BigDecimal amountOld) {
        this.amountOld = amountOld;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TaskMouldRequireEntity that = (TaskMouldRequireEntity) o;

        if (tmrId != that.tmrId) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (amountOld != null ? !amountOld.equals(that.amountOld) : that.amountOld != null) return false;
        if (requirement != null ? !requirement.equals(that.requirement) : that.requirement != null) return false;
        if (requirementOld != null ? !requirementOld.equals(that.requirementOld) : that.requirementOld != null)
            return false;
        if (tmId != null ? !tmId.equals(that.tmId) : that.tmId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = tmrId;
        result = 31 * result + (requirement != null ? requirement.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (tmId != null ? tmId.hashCode() : 0);
        result = 31 * result + (requirementOld != null ? requirementOld.hashCode() : 0);
        result = 31 * result + (amountOld != null ? amountOld.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }
}
